package com.securitytrace.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
/**
 * 
 * 条形码实体类
 *
 */
@Entity
@Table(name="bar_code")
public class BarCode implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6315589906836263005L;

	@Id
	private String id;
	
	@OneToOne
	private AntiFakeCode antiFakeCode;

	@OneToOne
	private Product product;
	
	@OneToMany(mappedBy="barCode",targetEntity=BarCodeRecordedInfo.class)
	private Set<BarCodeRecordedInfo> recordedInfoSet;

	public void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return id;
	}

	public void setAntiFakeCode(AntiFakeCode antiFakeCode) {
		this.antiFakeCode = antiFakeCode;
	}

	public AntiFakeCode getAntiFakeCode() {
		return antiFakeCode;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Product getProduct() {
		return product;
	}

	public void setRecordedInfoSet(Set<BarCodeRecordedInfo> recordedInfoSet) {
		this.recordedInfoSet = recordedInfoSet;
	}

	public Set<BarCodeRecordedInfo> getRecordedInfoSet() {
		return recordedInfoSet;
	}
}
